package com.my.zidingyikongjian.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.FrameLayout;

import com.my.zidingyikongjian.R;
import com.my.zidingyikongjian.view.two.DrawLineRoute;
import com.my.zidingyikongjian.view.two.DrawRectCWAndCCW;
import com.my.zidingyikongjian.view.two.DrawRoundRectRoute;

public class DrawRouteAndTextActivity extends AppCompatActivity {
    private FrameLayout flTwo;
    private String isWho;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_draw_route_and_text);
        Intent dataIntnet = getIntent();
        isWho = dataIntnet.getStringExtra("two");

        initView();
    }

    private void initView() {
        flTwo = findViewById(R.id.fl_two);

        if (isWho.equals("1")) { // 直线路径
            flTwo.addView(new DrawLineRoute(this));
        } else if (isWho.equals("2")) {
            flTwo.addView(new DrawRectCWAndCCW(this, false));
        } else if (isWho.equals("3")) {
            flTwo.addView(new DrawRectCWAndCCW(this, true));
        } else if (isWho.equals("4")) {
            flTwo.addView(new DrawRoundRectRoute(this, 0));
        } else if (isWho.equals("5")) {
            flTwo.addView(new DrawRoundRectRoute(this, 1));
        } else if (isWho.equals("6")) {
            flTwo.addView(new DrawRoundRectRoute(this, 2));
        } else if (isWho.equals("7")) {
            flTwo.addView(new DrawRoundRectRoute(this, 3));
        }
    }
}
